/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.hieu.sms.model;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * 
 * @author do_th
 */
@Entity
@Table(name = "graduated_condition_param")
@NamedQueries({
		@NamedQuery(name = "GraduatedConditionParam.findAll", query = "SELECT g FROM GraduatedConditionParam g"),
		@NamedQuery(name = "GraduatedConditionParam.findById", query = "SELECT g FROM GraduatedConditionParam g WHERE g.id = :id"),
		@NamedQuery(name = "GraduatedConditionParam.findByDepId", query = "SELECT g FROM GraduatedConditionParam g WHERE g.depId = :depId"),
		@NamedQuery(name = "GraduatedConditionParam.findByStudentLevel", query = "SELECT g FROM GraduatedConditionParam g WHERE g.studentLevel = :studentLevel"),
		@NamedQuery(name = "GraduatedConditionParam.findByTotalUnitRequired", query = "SELECT g FROM GraduatedConditionParam g WHERE g.totalUnitRequired = :totalUnitRequired"),
		@NamedQuery(name = "GraduatedConditionParam.findByTotalUnitPhrase1", query = "SELECT g FROM GraduatedConditionParam g WHERE g.totalUnitPhrase1 = :totalUnitPhrase1"),
		@NamedQuery(name = "GraduatedConditionParam.findByTotalUnitPhrase2", query = "SELECT g FROM GraduatedConditionParam g WHERE g.totalUnitPhrase2 = :totalUnitPhrase2") })
public class GraduatedConditionParam extends AbstractPersistentEntity {
	private static final long serialVersionUID = 1L;
	@Id
	@Column(name = "id", updatable = false)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "GraduatedConditionParamSequence")
	@SequenceGenerator(name = "GraduatedConditionParamSequence", sequenceName = "seq_graduated_condition_param", allocationSize = 1)
	private Long id;
	@Basic(optional = false)
	@Column(name = "dep_id")
	private String depId;
	@Basic(optional = false)
	@Column(name = "student_level")
	private String studentLevel;
	@Basic(optional = false)
	@Column(name = "total_unit_required")
	private int totalUnitRequired;
	@Column(name = "total_unit_phrase1")
	private Integer totalUnitPhrase1;
	@Column(name = "total_unit_phrase2")
	private Integer totalUnitPhrase2;

	public GraduatedConditionParam() {
	}

	public GraduatedConditionParam(Long id) {
		this.id = id;
	}

	public GraduatedConditionParam(Long id, String depId, String studentLevel,
			int totalUnitRequired) {
		this.id = id;
		this.depId = depId;
		this.studentLevel = studentLevel;
		this.totalUnitRequired = totalUnitRequired;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getDepId() {
		return depId;
	}

	public void setDepId(String depId) {
		this.depId = depId;
	}

	public String getStudentLevel() {
		return studentLevel;
	}

	public void setStudentLevel(String studentLevel) {
		this.studentLevel = studentLevel;
	}

	public int getTotalUnitRequired() {
		return totalUnitRequired;
	}

	public void setTotalUnitRequired(int totalUnitRequired) {
		this.totalUnitRequired = totalUnitRequired;
	}

	public Integer getTotalUnitPhrase1() {
		return totalUnitPhrase1;
	}

	public void setTotalUnitPhrase1(Integer totalUnitPhrase1) {
		this.totalUnitPhrase1 = totalUnitPhrase1;
	}

	public Integer getTotalUnitPhrase2() {
		return totalUnitPhrase2;
	}

	public void setTotalUnitPhrase2(Integer totalUnitPhrase2) {
		this.totalUnitPhrase2 = totalUnitPhrase2;
	}

	@Override
	public int hashCode() {
		int hash = 0;
		hash += (id != null ? id.hashCode() : 0);
		return hash;
	}

	@Override
	public boolean equals(Object object) {
		// TODO: Warning - this method won't work in the case the id fields are
		// not set
		if (!(object instanceof GraduatedConditionParam)) {
			return false;
		}
		GraduatedConditionParam other = (GraduatedConditionParam) object;
		if ((this.id == null && other.id != null)
				|| (this.id != null && !this.id.equals(other.id))) {
			return false;
		}
		return true;
	}

	@Override
	public String toString() {
		return "com.hieu.sms.model.GraduatedConditionParam[ id=" + id + " ]";
	}

}
